//package com.justgame.project.cloud.gateway.filter;
//
//import com.justgame.project.cloud.common.constant.Result;
//import com.justgame.project.cloud.common.util.HttpContextUtil;
//import com.justgame.project.service.api.entity.SysLog;
//import com.justgame.project.module.service.sys.SysLogService;
//import lombok.AllArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.aspectj.lang.annotation.AfterReturning;
//import org.aspectj.lang.annotation.Aspect;
//import org.springframework.stereotype.Component;
//
//import javax.servlet.http.HttpServletRequest;
//
//@Component
//@Aspect
//@Slf4j
//@AllArgsConstructor
//public class ResponseListener {
//    private final SysLogService logService;
//
//    /**
//     * 拦截所有Response，记录日志
//     * execution中的文件夹扫描的'*'指当前层数
//     *
//     * @param ret
//     */
//    @AfterReturning(
//            returning = "ret",
//            pointcut = "execution( * com.justgame.project.module.controller.*.*.*(..))"
//    )
//    public void logSign1(Object ret) {
//        if (ret != null) {
//            /* 异步执行记录日志 */
//            HttpServletRequest request = HttpContextUtil.getHttpRequest();
//            Result<Object> result = (Result<Object>) ret;
//            SysLog logs = new SysLog(result, request);
//            logService.doServerLog(logs);
//        }
//    }
//
//}
